#ifndef DEVICELISTMODEL_H
#define DEVICELISTMODEL_H

#include "devicelist.h"

class DeviceListModel : public QObject
{

        Q_OBJECT
    public:
    explicit DeviceListModel(QObject *parent = nullptr){}
        Q_PROPERTY(DeviceList* polygons READ polygons CONSTANT)

        DeviceList* polygons(void) { return &_polygons; }
        int rowCount(const QModelIndex &parent) const {return 0;}//_polygons.rowCountRead();}
        void addDevice(QString name_, QString portname_, QString protocol_, QString addr_)
        {
            _polygons.addDevice( name_,  portname_,  protocol_,  addr_);
            emit dataChanged();
        }
        void changeName(int index){_polygons.changeName(index);}
    signals:
        void dataChanged();
    public slots:

    private:
        DeviceList  _polygons;
};

#endif // DEVICELISTMODEL_H
